#ifndef FIDDLE_VEC_2_H
#define FIDDLE_VEC_2_H

namespace Fiddle
{

template<typename T>
class Vec2
{
public:
	T x, y;

	Vec2(){};
	Vec2( const T& x, const T& y ): x(x), y(x) {};

	Vec2<T>& operator = ( const Vec2<T>& other )
	{
		x = other.x;
		y = other.y;
		return *this;
	}

	bool operator == ( const Vec2<T>& other ) const
	{
		return x == other.x && y == other.y;
	}

	Vec2<T> operator + ( const Vec2<T>& other ) const 
	{
		return Vec2<T>( x + other.x, y + other.y );
	}

	Vec2<T> operator - ( const Vec2<T>& other ) const
	{
		return Vec2<T>( x - other.x, y - other.y );
	}

	Vec2<T> operator * ( float scalar ) const
	{
		return Vec2<T>( T(x * scalar), T(y * scalar) );
	}

	Vec2<T> operator * ( int scalar ) const
	{
		return Vec2<T>( T(x * scalar), T(y * scalar) );
	}

	Vec2<T> operator / ( float scalar ) const
	{
		return Vec2<T>( x / scalar, y / scalar );
	}




	Vec2<T>& operator += ( const Vec2<T>& other )
	{
		x += other.x;
		y += other.y;
		return *this;
	}

	Vec2<T>& operator -= ( const Vec2<T>& other )
	{
		x -= other.x;
		y -= other.y;
		return *this;
	}

	Vec2<T>& operator *= ( float scalar )
	{
		x *= scalar;
		y *= scalar;
		return *this;
	}

	Vec2<T>& operator /= ( float scalar )
	{
		x /= scalar;
		y /= scalar;
		return *this;
	}

};


typedef Vec2<float> Vec2f;
typedef Vec2<int> Vec2i;

}//End NS Fiddle

#endif